import { pubRequire, pubRequireFree } from '@utils/public'
import qs from 'qs'
const baseUrl = '/activities/flowers'
/* 新增鲜花活动 */
export function addFlowerActive(obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callbBack, errBack)
}
// 鲜花活动验证活动名称是否重复
export function getVerifications(name, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/verifications/?name=${name}`, '', callbBack, errBack)
}

// 根据id查询鲜花活动详情
export function getActiveDetail(id, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/${id}`,'', callbBack, errBack)
}
// 编辑鲜花活动
export function editActive(id,obj, callbBack, errBack) {
  return pubRequire('put', `${baseUrl}/${id}`, obj, callbBack, errBack)
}

// 查询鲜花活动说明
export function getDescriptions(callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/descriptions`,'', callbBack, errBack)
}
// 鲜花活动-新增活动说明
export function addDescriptions(obj, callbBack, errBack) {
  return pubRequire('post', `${baseUrl}/descriptions?${qs.stringify(obj)}`, '', callbBack, errBack)
}